package fr.vahren.dotastrat.model;

import java.util.List;

import org.json.simple.JSONObject;

import fr.vahren.dotastrat.game.D2SGame;
import fr.vahren.dotastrat.game.D2SGameState;
import fr.vahren.dotastrat.game.effect.D2SEffect;

public class D2STower extends D2SUnit {

	private int tier;
	private D2SSide side;
	private String name;
	private int currentHealth;
	private int id;

	private static final int[] damage = { 25, 30, 40, 40 };
	private static final int[] health = { 160, 225, 225, 225 };
	private static final int[] armor = { 20, 20, 25, 30 };
	private static final int[] bounty = { 264, 312, 358, 405 };
	private static final int[] bountyDenied = { 100, 120, 140, 160 };

	public D2STower(String name, int tier) {
		this.name = name;
		this.tier = tier;
		currentHealth = health[tier];
		id = D2SGame.id();
	}

	public int getDamage() {
		return damage[tier];
	}

	public int getArmor() {
		return armor[tier];
	}

	public int getBounty() {
		return bounty[tier];
	}

	public int getBountyDenied() {
		return bountyDenied[tier];
	}

	/**
	 * @return the tier
	 */
	public int getTier() {
		return tier;
	}

	/**
	 * @param tier
	 *            the tier to set
	 */
	public void setTier(int tier) {
		this.tier = tier;
	}

	/**
	 * @return the side
	 */
	public D2SSide getSide() {
		return side;
	}

	/**
	 * @param side
	 *            the side to set
	 */
	public void setSide(D2SSide side) {
		this.side = side;
	}

	@Override
	public void applyAttackDamage(D2SUnit target, boolean reduced, D2SUnit unit) {
		// TODO Auto-generated method stub

	}

	@Override
	public void removeHealth(int dmg) {
		// TODO Auto-generated method stub

	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public int getId() {
		return id;
	}

	@Override
	public int getCurrentHealth() {
		return currentHealth;
	}

	@Override
	public int getMaxHealth() {
		return health[tier];
	}

	@Override
	public int getCurrentMana() {
		return 0;
	}

	@Override
	public int getMaxMana() {
		return 0;
	}

	@Override
	public boolean isMoving() {
		return false;
	}

	@Override
	public void addAttacker(int id) {
		// DOES NOTHING

	}

	@Override
	public boolean isDead() {
		return currentHealth <= 0;
	}

	@Override
	public int getSpeed() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<D2SEffect> getEffects() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public JSONObject generateInfo(D2SGameState phase) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int getAttackRange() {
		return 1;
	}

	@Override
	public int getGoldBounty(int nbAttackers) {
		return bounty[tier];
	}

	@Override
	public int getExpBounty(int size) {
		return 0;
	}

}
